package cn.jawar.framework.cloud.demo.invoke.biz;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class InvokeController {

    @Autowired
    private RestTemplate restTemplate;
    @Autowired
    private UserControllerService userControllerService;
    @Value("${notify}")
    private String value;

    @GetMapping("test1")
    public User test1() {
        return restTemplate.getForObject("http://demo-user/user", User.class);
    }

    @GetMapping("test2")
    public User test2() {
        return userControllerService.getUser();
    }

    @GetMapping("/test3")
    public String test3() {
        return value;
    }
}
